import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },{
      path: '/index',
      name: 'Layout',
      component: () => import('@/views/layout/Index'),
      children: [{
        path: '/index',
        name: 'Home',
        component: () => import('@/views/home/Index')
      },{
        path: '/producet',
        name: 'Producet',
        component: () => import('@/views/producet/Index'),
        children: [
          {
            path: 'list',
            name: 'List',
            component: () => import('@/views/producet/list/Index')
          },{
            path: 'category',
            name: 'Category',
            component: () => import('@/views/producet/category/Index')
          }
        ]
      },{
        path: '/order',
        name: 'Order',
        component: () => import('@/views/order/Index'),
        children: [
          {
            path: 'list',
            name: 'Order-List',
            component: () => import('@/views/order/list/Index')
          },{
            path: 'collect',
            name: 'Collect',
            component: () => import('@/views/order/collect/Index')
          }
        ]
      },{
        path: '/advert',
        name: 'Advert',
        component: () => import('@/views/advert/Index'),
        children: [
          {
            path: 'list',
            name: 'Advert-List',
            component: () => import('@/views/advert/list/Index')
          }
        ]
      },{
        path: '/system',
        name: 'System',
        component: () => import('@/views/system/Index'),
        children: [
          {
            path: 'permission',
            name: 'Permission',
            component: () => import('@/views/system/permission/Index')
          }
        ]
      }
      ]
    }
  ]
})
